package cn.edu.sdjzu.xg.bysj.domain;

import java.io.Serializable;

public final class Department implements Comparable<Department>, Serializable {
    public Department(int id,String description, String no,String remarks, School school){
        this.id = id;
        this.description = description;
        this.no = no;
        this.remarks = remarks;
        this.school = school;
    }

    public String getDescription(){
        return this.description;
    }
    public String getNo(){
        return this.no;
    }

    public String getRemarks() {
        return remarks;
    }

    public School getSchool(){
        return this.school;
    }
    public int getId(){return this.id;}


    @Override
    public String toString(){
        final String TAB ="   ";
        return "{" + "id:" + this.id + "," + TAB +
                "description:" + description + "," + TAB +
                "no:" + no + "," + TAB +
                "school:" + this.school + "}\n";
    }

    /**
     * 如果本对象的id比较大，则返回-1
     * 在有序集合中，id大的排在前面
     */
    @Override
    public int compareTo(Department o) {
        return o.id - this.id;
    }

    private int id;
    private String description;
    private String no;
    private String remarks;
    private School school;
}

